feat(harness): plugin skeleton — plugin.json + ${CLAUDE_PLUGIN_ROOT} script refs (closes #36) - #43
Merged
Conversation
…script refs (#36) Add .claude/.claude-plugin/plugin.json (plugin name "orchestrator", so commands auto-namespace as /orchestrator:* when installed) and .claude/hooks/hooks.json mirroring the lint/test_affected hooks from settings.json, referencing scripts via ${CLAUDE_PLUGIN_ROOT}. Migrate every `bash .claude/scripts/<name>.sh` invocation in agents/*.md and commands/*.md to `bash ${CLAUDE_PLUGIN_ROOT:-.claude}/scripts/<name>.sh` so downstream plugin installs resolve scripts correctly while the in-repo fallback keeps the live self-hosting loop byte-identical. Extend the self build gate to JSON-validate the two new artifacts. Add a short plugin README. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WNHtY86twXHEKsLEucSJyY
robercano
approved these changes
Jul 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Packaging phase 1: plugin skeleton (closes #36)
Packages this orchestration harness as a Claude Code plugin, additively — the in-repo
.claude/self-hosting flow that this repo's own live PR loop runs on stays fully intact.What changed (all under
.claude/**).claude/.claude-plugin/plugin.json(nameorchestrator, v0.1.0). Placing the manifest at.claude/.claude-plugin/makes the plugin root.claude/, socommands/,agents/,hooks/hooks.json, andscripts/auto-discover from the existing tree — no files relocated.orchestrator: installed, commands invoke as/orchestrator:pr-loopetc.; in-repo they stay project-level/pr-loop. No command files renamed, so in-repo invocations are unchanged..claude/hooks/hooks.jsonmirrors the settings.json lint/test hooks using${CLAUDE_PLUGIN_ROOT}. Inert in-repo (plugin hooks activate only when the plugin is installed), so it never double-fires the repo's settings.json hooks.bash .claude/scripts/…invocation in agent/command prompts →bash ${CLAUDE_PLUGIN_ROOT:-.claude}/scripts/…(15 invocations acrossimplementer.md,test-runner.md,pr-loop.md,pr-loop-self.md,setup-orchestrator.md,test-pr.md)..claude/self/checks.shdo_buildnow JSON-validates both new artifacts (plugin.json,hooks.json) in its parse loop; correctly excluded from the adapter-shape check.Backward-compatible migration (in-repo self-hosting preserved)
The fallback
${CLAUDE_PLUGIN_ROOT:-.claude}is the crux: when the var is unset (in-repo dogfooding) it expands to.claude, giving byte-identical.claude/scripts/…resolution — so the live loop is unchanged; when the plugin is installed it resolves from the install path. The loop-critical scripts (notify-poll,merge-ready,pr-feedback,gate,bot-gh,worktree,prepare-pr) are not moved/renamed;.claude/settings.jsonhooks are untouched and still call them by literal path. Config paths (.claude/gates.json,GATES_FILE=.claude/self/gates.json) stay project-relative (adapter lives in the consuming project, not the plugin root).Out of scope (later phases)
.claude/workflows/*.js(not plugin-distributable) and.claude/self/*stay repo-scaffolded; setup/sync skills (phases 2–3) and marketplace+docs (phase 4) are not included.Verification
buildexit 0,lintexit 0,testexit 0.🤖 Generated with Claude Code
https://claude.ai/code/session_01WNHtY86twXHEKsLEucSJyY